package com.study.io.bio.demo;

import java.util.Random;

public class main {

	public static void main(String [] args) throws InterruptedException {
		new Thread(new Runnable(){

			@Override
			public void run() {
				try{
					ServerNormal.start();
				}catch(Exception e) {
					e.printStackTrace();
				}
			}
		}).start();
		
		Thread.sleep(200);
		
		new Thread(new Runnable(){

			Random random = new Random(System.currentTimeMillis());
			
			//@SuppressWarnings("static-access")
			@SuppressWarnings("static-access")
			@Override
			public void run() {

				while(true){
					String expression = random.nextInt(10) + "";
					Client.send(expression);
					try{
						Thread.currentThread().sleep(random.nextInt(1000));
					}catch (Exception e){
						e.printStackTrace();
					}
				}
			}
			
		}).start();
	}
}
